<?php 
    $logado = '';
    if (Zend_Auth::getInstance()->hasIdentity() && Zend_Auth::getInstance()->getStorage()->read()->USU_LOGIN > '') 
        $logado = 'logado'; 
?>

<div id="st-menu" class="<?php echo $logado; ?>">
    <div class="st-menu-c-content">
        <h1 class="logo">
            <a title="Cursos Ead Professor Neneco" href="<?php echo $this->urlbase; ?>/"></a>
        </h1>
        
        <span class="barra"></span>
        
        <div class="search">
            <a href="#" class="act-fnd-tp"></a>
            <div id="tp-fnd-tp">
                <form id="form_pes" action="<?php echo $this->urlbase.'/pesquisa'; ?>" method="post">
                   <input type="text" name="search" placeholder="Pesquisar" value="" /> 
                </form>
            </div>    
        </div>
        
        <div id="hlogin" class="hlogin">
            <?php if (!Zend_Auth::getInstance()->hasIdentity() && empty(Zend_Auth::getInstance()->getStorage()->read()->USU_LOGIN)) { ?>
            <a href="#" class="act-lg-tp">Login <span class="mnr">ou</span> <span class="cadastrar">Cadastre-se</span></a>
            <div id="tp-lg-cad-tp">
                <form id="form_login" method="post">
                    <input type="text" name="usuario" placeholder="Usuário" value="" />
                    <input type="password" name="senha" placeholder="Senha" value="" />
                    <button type="submit">Entrar</button><span class="esqueci"><a href="<?php echo $this->urlbase.'/esqueciminhasenha'; ?>">Esqueci minha senha.</a></span>
                </form>
                <div class="cadastro">
                    <div style="display: none;">
                    <div class="content-loader"><img class="loader" src='<?php echo $this->urlbase; ?>/public/media/images/loader_cz.gif' /></div>
                    <a class="facebook showloader" href="https://www.facebook.com/dialog/oauth?client_id=142491082620110&redirect_uri=http://neneco.com.br/site/&scope=email,user_location,user_birthday"></a>
                    <?php /* if ($user){ ?>
                      <a href="<?php echo $fbUrl; ?>">Logout</a>
                    <?php } else { ?>
                      <a href="<?php echo $fbUrl; ?>">Login with Facebook</a>
                    <?php } */?>
                    <span>ou</span></div>
                    <a href="<?php echo $this->urlbase.'/login'; ?>">Cadastre-se</a>
                </div>
            </div>  
            <?php } else { ?>
            <a href="<?php echo $this->urlbase.'/ead'; ?>">Acesse aqui seus cursos</a><a href="<?php echo $this->urlbase.'/login/logout'; ?>">Sair</a>
            <?php } ?>
        </div>
        <?php if (Zend_Auth::getInstance()->hasIdentity() && Zend_Auth::getInstance()->getStorage()->read()->USU_LOGIN > ''){ ?>
        <div class="ctn">
            <span class="txt">Olá <span class="nom"><?php echo Zend_Auth::getInstance()->getStorage()->read()->USU_NOME; ?>.</span></span>  
        </div>  
        <?php } ?>
    </div>
</div>   

<?php
    if($this->controller == 'index' || $this->controller == '') $class = '';
    else $class = '_int';
?>
<div class="st-cont-slider<?php echo $class; ?>">
    
    <div id="slider-home">
        <?php
        if($this->controller == 'index' || $this->controller == '') {
        $obj = new Ead_Model_DbTable_Fullbanner();
        $banner = $obj->fetchAll($obj->select()->where('BAN_STA = 1')->order('BAN_ORD ASC'));
        
        foreach($banner as $ban) {
            $img = 'public/upload/fullbanner/'.$ban->BAN_ID.'.*';
            foreach (glob($img) as $src) {
              $img = $src;
            } 
        ?>
        <a href="<?php echo $ban->BAN_LNK;?>">
            <img src="<?php echo $this->urlbase.'/'.$img;?>"  height="300px"  width="800px" />
        </a>
        <?php  }  ?>
    </div>
    <div class="nav-slider">
        <a href="#" id="prev"></a>
        <a href="#" id="next"></a>
    </div>
        
 <?php   } else { 
        $obj = new Ead_Model_DbTable_Paginassite();
        $row = $obj->fetchRow('PAG_MODULO like "'.$this->controller.'"');
        if(isset($row->PAG_ID)) {
            $img = 'public/upload/paginassite/'.$row->PAG_ID.'.*';
            foreach (glob($img) as $src) {
                $img = $src;
            } 
            ?>
            <img src="<?php echo $this->urlbase.'/'.$img;?>"  height=200px"  width="800px" />
        <?php  } ?>
     </div>
 <?php   } ?>
       
    
</div>
<?php if($this->controller == 'index' || $this->controller == '') { ?>
<script src="<?php echo $this->urlbase;?>/public/media/js/jquery.cycle.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() { 
    $('#slider-home').cycle({ 
        fx: 'scrollHorz', 
        timeout: 12000, 
        prev:    '#prev', 
        next:    '#next'
    });
});
</script> 
<?php } ?>

<div id="st-sub-menu">
    <a href="<?php echo $this->urlbase; ?>/" class="home"></a>
    <ul>
        <li><a class="mn" href="<?php echo $this->urlbase."/conheca"; ?>">Conhe&ccedil;a o Neneco</a></li>
        <li><a class="mn" href="<?php echo $this->urlbase."/cursos"; ?>">Cursos</a></li>
        <li>
            <a class="mn act-menu-h-tp" href="javascript:void(0);">Materiais Gratuitos</a>
            <div class="tp_h_menu_tp tp-bl-sub">
                <a href="<?php echo $this->urlbase."/videoaulas"; ?>">Videoaulas</a> 
                <span class="barra"></span>
                <a href="<?php echo $this->urlbase."/materiais"; ?>">Impressos</a> 
            </div>
        </li>
        <li><a class="mn" href="<?php echo $this->urlbase."/contato"; ?>">Contato</a></li>
    </ul>
</div>
